package com.ichoice.rabbitmq.rpc.helper.sub;

import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import javax.annotation.PreDestroy;

/**
 * @author xianrensawang
 * @date 2021/4/21
 */
@Component
@Slf4j
public class DestroyHelper {

    /**
     * 将缓存内的发布订阅消息重新广播到队列里
     */
    @PreDestroy
    public void destroy(){
//        ConcurrentHashMap<String, Map<String, SubScribeModel>> all = SubScribeStoreHelper.getAll();
//        all.forEach((k,v)->v.forEach((k1,v1)->{
//            SubScribeHelper.subscribe(v1);
//            log.info("程序退出,重新缓存发布订阅数据成功:{}",v1.toString());
//        }));
    }

}
